<template>
        <view class="todo-box">
            <view class="date">{{ currentDate }}</view>
            <u-cell-group :border="false">
                <!-- <u-cell :isLink="true" :border="false" :clickable="false" v-for="(item, index) in list" :key="index">
                    <view slot="title" class="u-slot-title" >
                        <text>{{ item.title }}</text>
                        <text class="u-cell-text">{{ item.title }}</text>
                    </view>
                    <text slot="value" class="u-slot-value">{{ item.tips }}</text>
                </u-cell> -->
                <u-cell @click="toTask()" :isLink="true" :border="false" :clickable="false" :icon="'/static/img/toDo/follow.png'" :iconStyle="{width: '40rpx', height: '40rpx', marginRight: '10rpx'}">
                    <view slot="title" class="u-slot-title" >
                        <text class="u-cell-text">待跟进任务</text>
                    </view>
                    <text slot="value" class="u-slot-value">{{ result.followupCount }}</text>
                </u-cell>
                <u-cell @click="toOrder()" :isLink="true" :border="false" :clickable="false" :icon="'/static/img/toDo/approval.png'" :iconStyle="{width: '40rpx', height: '40rpx', marginRight: '10rpx'}">
                    <view slot="title" class="u-slot-title" >
                        <text class="u-cell-text">待审批订单</text>
                    </view>
                    <text slot="value" class="u-slot-value">{{ result.orderStatistics }}</text>
                </u-cell>
                <u-cell @click="toPayment()" :isLink="true" :border="false" :clickable="false" :icon="'/static/img/toDo/returnMoney.png'" :iconStyle="{width: '40rpx', height: '40rpx', marginRight: '10rpx'}">
                    <view slot="title" class="u-slot-title" >
                        <text class="u-cell-text">待审批回款</text>
                    </view>
                    <text slot="value" class="u-slot-value">{{ result.payumentReceivedorderStatistics }}</text>
                </u-cell>
                <u-cell @click="toRefund()" :isLink="true" :border="false" :clickable="false" :icon="'/static/img/toDo/refundMoney.png'" :iconStyle="{width: '40rpx', height: '40rpx', marginRight: '10rpx'}">
                    <view slot="title" class="u-slot-title" >
                        <text class="u-cell-text">待审批退款</text>
                    </view>
                    <text slot="value" class="u-slot-value">{{ result.refundStatistics }}</text>
                </u-cell>
            </u-cell-group>
        </view>
</template>

<script>
export default {
    data() {
        return {
            result: {},
            currentDate: null
        }
    },
    created() {
        this.setCurrentDate()
        this.getData()
    },
    methods: {
        setCurrentDate() {
            const date = new Date()
            const year = date.getFullYear()
            const month = String(date.getMonth() + 1).padStart(2, '0') // 月份从0开始，需要加1
            const day = String(date.getDate()).padStart(2, '0')
            this.currentDate = `${year}-${month}-${day}`
        },
        getData() {
			this.$http.get('/app/statistics/performance/backlogItemList', {}).then(res => {
				if (res.code == 200) {
                    this.result = res.data
				}
			})
		},
        toTask() {
            uni.navigateTo({
                url: '/pages/task/taskList'
            });
        },
        // 订单审批
        toOrder() {
            uni.navigateTo({
                url: '/pages/examine/orderApproval'
            });
        },
        // 回款审批
        toPayment() {
            uni.navigateTo({
                url: '/pages/examine/paymentApproval'
            });
        },
        // 退款审批
        toRefund() {
            uni.navigateTo({
                url: '/pages/examine/refundApproval'
            });
        }
    }
}
</script>

<style lang="scss" scoped>
    .todo-box {
        padding: 32rpx;
        background: rgb(255, 255, 255);
        /deep/.u-cell__body {
                padding-left: 0;
                padding-right: 0;
            }
        .date {
            font-size: 32rpx;
            font-weight: 500;
            color: rgba(12, 16, 25, 1);
            margin-bottom: 30rpx;
        }
    }
</style>